<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Picture-Manager: Picture Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Picture-Manager
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_picture.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_picture-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Picture Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Able to manage Shapes and save/load them to/from a file.  
 <a href="class_picture.html#details">More...</a></p>

<p><code>#include &lt;Picture.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Picture:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_picture.png" usemap="#Picture_map" alt=""/>
  <map id="Picture_map" name="Picture_map">
<area href="class_object.html" title="Common Baseclass for all other classes." alt="Object" shape="rect" coords="0,0,52,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac7fb036c655f44714032731851a3714e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#ac7fb036c655f44714032731851a3714e">Picture</a> (std::string filename, <a class="el" href="class_i_shape_factory.html">IShapeFactory</a> *fact)</td></tr>
<tr class="memdesc:ac7fb036c655f44714032731851a3714e"><td class="mdescLeft">&#160;</td><td class="mdescRight">CTor of the <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a>.  <a href="#ac7fb036c655f44714032731851a3714e"></a><br/></td></tr>
<tr class="separator:ac7fb036c655f44714032731851a3714e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a277f070f83063fa0922d2c1de8889a58"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#a277f070f83063fa0922d2c1de8889a58">~Picture</a> ()</td></tr>
<tr class="memdesc:a277f070f83063fa0922d2c1de8889a58"><td class="mdescLeft">&#160;</td><td class="mdescRight">DTor of the <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a>.  <a href="#a277f070f83063fa0922d2c1de8889a58"></a><br/></td></tr>
<tr class="separator:a277f070f83063fa0922d2c1de8889a58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f1dece62dd35b2cab31f7cbab040a65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#a5f1dece62dd35b2cab31f7cbab040a65">AddCircle</a> (<a class="el" href="struct_t_position.html">TPosition</a> const &amp;origin, float const &amp;radius, std::string const &amp;color)</td></tr>
<tr class="memdesc:a5f1dece62dd35b2cab31f7cbab040a65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a circle to the picture.  <a href="#a5f1dece62dd35b2cab31f7cbab040a65"></a><br/></td></tr>
<tr class="separator:a5f1dece62dd35b2cab31f7cbab040a65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c23b8d5017934aaf47804c9b2daaf00"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#a8c23b8d5017934aaf47804c9b2daaf00">AddRectangle</a> (<a class="el" href="struct_t_position.html">TPosition</a> const &amp;origin, <a class="el" href="struct_t_size.html">TSize</a> const &amp;dimension, std::string const &amp;color)</td></tr>
<tr class="memdesc:a8c23b8d5017934aaf47804c9b2daaf00"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a rectangle to the picture.  <a href="#a8c23b8d5017934aaf47804c9b2daaf00"></a><br/></td></tr>
<tr class="separator:a8c23b8d5017934aaf47804c9b2daaf00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42a1e6f478f278635a7f17e555aa69b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42a1e6f478f278635a7f17e555aa69b7"></a>
std::string const &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#a42a1e6f478f278635a7f17e555aa69b7">getFileName</a> () const </td></tr>
<tr class="memdesc:a42a1e6f478f278635a7f17e555aa69b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the associated Filename of the picture. <br/></td></tr>
<tr class="separator:a42a1e6f478f278635a7f17e555aa69b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3598504998dc200915bdc3d4a379aca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#ad3598504998dc200915bdc3d4a379aca">LoadShapes</a> (std::string const &amp;filename)</td></tr>
<tr class="memdesc:ad3598504998dc200915bdc3d4a379aca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads Shapes from a file (to initialize a picture)  <a href="#ad3598504998dc200915bdc3d4a379aca"></a><br/></td></tr>
<tr class="separator:ad3598504998dc200915bdc3d4a379aca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a567ffd503c9a9ceca76c3525e380b269"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_picture.html#a567ffd503c9a9ceca76c3525e380b269">WriteSVG</a> () const </td></tr>
<tr class="memdesc:a567ffd503c9a9ceca76c3525e380b269"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the image to its associated file.  <a href="#a567ffd503c9a9ceca76c3525e380b269"></a><br/></td></tr>
<tr class="separator:a567ffd503c9a9ceca76c3525e380b269"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#aa3e791419d84c4c346ef9499513b8e00">~Object</a> ()</td></tr>
<tr class="memdesc:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">DTor of the <a class="el" href="class_object.html" title="Common Baseclass for all other classes.">Object</a> class.  <a href="#aa3e791419d84c4c346ef9499513b8e00"></a><br/></td></tr>
<tr class="separator:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#a86a84ed2d1207e5f8827165ac2941106">deleteObject</a> (<a class="el" href="class_object.html">Object</a> *obj)</td></tr>
<tr class="memdesc:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the memory used by obj.  <a href="#a86a84ed2d1207e5f8827165ac2941106"></a><br/></td></tr>
<tr class="separator:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Able to manage Shapes and save/load them to/from a file. </p>
<p>The class <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a> manages a list of shapes. A <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a> offers functions to add circles and shapes to the list of managed shapes. Once a shape is added, it can't be removed again. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a277f070f83063fa0922d2c1de8889a58"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Picture::~Picture </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>DTor of the <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a>. </p>
<p>Frees the memory used by the managed shapes </p>

</div>
</div>
<a class="anchor" id="ac7fb036c655f44714032731851a3714e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Picture::Picture </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_i_shape_factory.html">IShapeFactory</a> *&#160;</td>
          <td class="paramname"><em>fact</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>CTor of the <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a>. </p>
<p>The constructor of the <a class="el" href="class_picture.html" title="Able to manage Shapes and save/load them to/from a file.">Picture</a> takes two parameters. It initializes the filename which can only be set when constructing the picture and it sets the Factory of the picture which also can't be changed during runtime. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>The filename where the picture stores its shapes </td></tr>
    <tr><td class="paramname">fact</td><td>A Pointer to a Factory. Currently there're a Filled- and a Transparent- ShapeFactory. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a5f1dece62dd35b2cab31f7cbab040a65"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Picture::AddCircle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_position.html">TPosition</a> const &amp;&#160;</td>
          <td class="paramname"><em>origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float const &amp;&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>color</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a circle to the picture. </p>
<p>The function <a class="el" href="class_picture.html#a5f1dece62dd35b2cab31f7cbab040a65" title="Adds a circle to the picture.">AddCircle()</a> adds a <a class="el" href="class_circle.html" title="Describes a Circle (holds its radius and gets position from Shape)">Circle</a> to the list of Shapes managed by the picture. Depending on the Factory the picture has, the circle is filled or transparent. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">origin</td><td>Position where the center of the circle should be </td></tr>
    <tr><td class="paramname">radius</td><td>The radius of the circle </td></tr>
    <tr><td class="paramname">color</td><td>The color which the stroke or the filling of the circle should have. If the string is empty, or the color is not recognized, it's changed to black. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>if the file wasn't found or couldn't be opened. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8c23b8d5017934aaf47804c9b2daaf00"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Picture::AddRectangle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_t_position.html">TPosition</a> const &amp;&#160;</td>
          <td class="paramname"><em>origin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_t_size.html">TSize</a> const &amp;&#160;</td>
          <td class="paramname"><em>dimension</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>color</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a rectangle to the picture. </p>
<p>The function <a class="el" href="class_picture.html#a8c23b8d5017934aaf47804c9b2daaf00" title="Adds a rectangle to the picture.">AddRectangle()</a> adds a rectangle to the list of Shapes managed by the picture. Depending on the Factory the picture has, the rectangle is filled or transparent. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">origin</td><td>Position where the upper left corner of the rectangle should be </td></tr>
    <tr><td class="paramname">dimension</td><td>The height and the width of the rectangle </td></tr>
    <tr><td class="paramname">color</td><td>The color which the stroke or the filling of the rectangle should have. If the string is empty, or the color is not recognized, it's changed to black. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad3598504998dc200915bdc3d4a379aca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Picture::LoadShapes </td>
          <td>(</td>
          <td class="paramtype">std::string const &amp;&#160;</td>
          <td class="paramname"><em>filename</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loads Shapes from a file (to initialize a picture) </p>
<p>Reads the file filename which must be a file structured like it's described in the system documentation to initialize the picture with shapes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>The Filename of the file which holds the shapes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>if the file wasn't found or couldn't be opened and if the file has a wrong format. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a567ffd503c9a9ceca76c3525e380b269"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Picture::WriteSVG </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Saves the image to its associated file. </p>
<p>Writes all the Shapes which are managed by the picture to their corresponding file. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_picture.html">Picture</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
